Repository Public
1/**2 * =============================================================================3 * SP BOUCHER | ACADEMIC RESEARCH4 * ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * PROJECT METADATA8 * -----------------------------------------------------------------------------9 * Project : UQO Éval10 * File : src/app/a-vendre/[uid]/analyse-cout/page.tsx11 * Module : app12 * Repository : https://git.spboucher.ai/uqo-eval13 * Project Website : https://www.uqo-eval.app14 * Created : 2026-10-0215 * Last Modified : 2026-10-0216 *17 * =============================================================================18 * SOFTWARE MAINTAINER & AFFILIATION19 * =============================================================================20 *21 * Maintainer : Simon-Pierre Boucher22 * Position : Professor of Finance23 * Institution : Université du Québec en Outaouais (UQO)24 * Department : Département des sciences administratives25 * Website : https://spboucher.ai26 * Git : https://git.spboucher.ai27 *28 * Research Contact : research@spboucher.ai29 * Direct Contact : simon@spboucher.ai30 * Security/Admin : admin@spboucher.ai31 *32 * The affiliation is descriptive. It is not an institutional endorsement,33 * a license grant or a determination of ownership.34 *35 * =============================================================================36 * COPYRIGHT, AUTHORSHIP & DATA37 * =============================================================================38 *39 * Copyright (c) the author(s) of this work.40 * Ownership is not asserted by this notice; see the repository records.41 *42 * This header identifies the maintainer of the software. Scientific43 * authorship of any associated paper is stated in the paper itself and44 * is not changed by this notice. Datasets and third-party materials45 * remain the property of their respective owners and licensors.46 *47 * This file is governed by the applicable project license, copyright48 * notices, institutional agreements and relevant law.49 *50 * =============================================================================51 * LICENSE & MAINTENANCE52 * =============================================================================53 *54 * License : None specified (no license file in this repository)55 * Classification : Public56 *57 * =============================================================================58 * END OF SP BOUCHER SOURCE HEADER59 * =============================================================================60 */6162// UQO Éval — laboratoire pédagogique d'évaluation immobilière63// Analyse IA du bâtiment d'une annonce : photos → profil technique (Claude Sonnet 5)64// → assemblages → coûts actuels → méthode du coût. Déclenchée sur demande seulement.65import type { Metadata } from "next";66import { notFound } from "next/navigation";67import { getListing } from "@/lib/immoka";68import { getLatest } from "@/lib/cost/ai/service";69import { moneyFr } from "@/lib/seo";70import AiCostAnalysis, { type AiHead } from "@/components/avendre/cost/AiCostAnalysis";7172export const dynamic = "force-dynamic";7374function head(uid: string): AiHead | null {75 const det = getListing(uid);76 if (!det) return null;77 const l = det.listing;78 return {79 uid: l.uid, address: l.address, city: l.city, propertyType: l.property_type, price: l.price, images: det.images, source: l.source, yearBuilt: l.year_built, areaSqft: l.area_sqft,80 unitId: det.eval?.unit_id ?? null, evalEst: det.eval?.est ?? null, modelEst: det.eval?.model_est ?? null, compsEst: det.eval?.comps_est ?? null, roleValue: det.eval?.valeur_role ?? null,81 maxImages: Number(process.env.PROPERTY_ANALYSIS_MAX_IMAGES ?? 40), model: process.env.PROPERTY_ANALYSIS_MODEL ?? "claude-sonnet-5",82 };83}8485export async function generateMetadata({ params }: { params: Promise<{ uid: string }> }): Promise<Metadata> {86 const { uid } = await params;87 const h = head(decodeURIComponent(uid));88 if (!h) return { title: "Propriété introuvable" };89 const where = [h.address, h.city].filter(Boolean).join(", ");90 return { title: `Analyse IA du bâtiment — ${where} (${moneyFr(h.price)})`, description: "Des photos à la méthode du coût : l'IA transforme une annonce réelle en profil technique de bâtiment ; les coûts actuels du marché sont ensuite appliqués composante par composante.", robots: { index: false, follow: false } };91}9293export default async function Page({ params }: { params: Promise<{ uid: string }> }) {94 const { uid } = await params;95 const h = head(decodeURIComponent(uid));96 if (!h) notFound();97 const initial = getLatest(h.uid);98 return <AiCostAnalysis head={h} initial={initial} />;99}100